<?php
// ici on affiche un texte en hut de la page pour le changer c'esty dans modules/message_haut.php
echo '' . Inscription . '';


?>      <div class="cadre_visible contenu">
	  <div class="titre">1 er &eacute;tape Informations n&eacute;cessaires (* champ obligatoire)</div>

	  <form method="post" action="<?php echo getLienModule('membre', 'inscription'); ?>">

	  <div class="inscription parente">
	  <div class="inscription1">Nom d'utilisateur :*</div>
	  <div class="inscription2"><input type="text" name="pseudo" id="pseudo" onKeyUp="verifPseudo(this.value)" value="<?php echo savedInputValue("pseudo"); ?>" /></div>
	  <div class="inscription3"><span class="boxVerif" id="pseudobox"></span>Caract&egrave;res autoris&eacute;s : lettres, chiffres, tiret, point</div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>


	  <div class="inscription parente">
	  <div class="inscription1">Mot de passe : *</div>
	  <div class="inscription2"><input type="password" name="password" id="password" value=""/></div>
	  <div class="inscription3">Maximum 12 caract&egrave;res parmi lettres et chiffres.</div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>

	  <div class="inscription parente">
	  <div class="inscription1">Confirmer le mot de passe : *</div>
	  <div class="inscription2"><input type="password" name="confirm_mdp" id="confirm" /></div>
	  <div class="inscription3"></div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>

	  <div class="inscriptionnot parente">
	  <div class="inscription1">Votre adresse courriel : *</div>
	  <div class="inscription2"><input type="text" name="email" id="email" onKeyUp="verifEmail(this.value)" value="<?php echo savedInputValue("email"); ?>"/></div>
	  <div class="inscription3"><span class="boxVerif" id="emailbox"></span></div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>
	  </div>

      <div class="cadre_visible contenu">
	  <div class="titre">2 er &eacute;tape Informations n&eacute;cessaires (* champ obligatoire)</div>

	  <div class="inscription parente">
	  <div class="inscription1">Votre pr&eacute;nom : *</div>
	  <div class="inscription2"><input type="text" name="prenom" id="prenom" value="<?php echo savedInputValue("prenom"); ?>"/></div>
	  <div class="inscription3"><span class="boxVerif" id="prenombox"></span></div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>

	  <div class="inscription parente">
	  <div class="inscription1">Votre sexe : *</div>
	  <div class="inscription2">

<?php


      $sx = savedInputValue("sexe");
	  if($sx=="homme")
echo '<input type="radio" name="sexe" value="homme" id="homme" checked="checked" />';
      else
echo '<input type="radio" name="sexe" value="homme" id="homme" />';

?>

      <span for="homme" style="float: none;"><img src="../../design/Basic/images/sexe/male.png" alt="Homme" title="Homme" /></span>

<?php

      if($sx=="femme")

echo '<input type="radio" name="sexe" value="femme" id="femme" checked="checked"/>';

      else

echo '<input type="radio" name="sexe" value="femme" id="femme" />';

?>

      <span for="femme" style="float: none;"><img src="../../design/Basic/images/sexe/female.png"alt="Femme" title="Femme" /></span>

	  </div>
	  <div class="inscription3"><span class="boxVerif" id="sexebox"></span></div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>

	  <div class="inscription parente">
	  <div class="inscription1">Date de naissance : *</div>
	  <div class="inscription2"><select name="dateN[0]" id="date">
						<?php
                        
						$saved = savedInputValue("dateN");
						if($saved[0] == "")
						   		echo "\n<option value='' selected='selected'>Jours</option>";
							else
								echo "\n<option value=''>Jours</option>";
								
						for($a=1;$a<=31;$a++)
						{
						  if($a < 10)
						   $a = "0" . $a;
						   
								
						 	if($saved[0] == $a)
						 		echo "\n<option value='".$a."' selected='selected'>".$a."</option>";
							else
								echo "\n<option value='".$a."'>".$a."</option>";
						}
						 
						?>
						</select> / <select name="dateN[1]" id="dateMonth">
						<?php
                        
						$saved = savedInputValue("dateN");
						
							if($saved[1] == "")
								echo "\n<option value='' selected='selected'>Mois</option>";
							else
								echo "\n<option value=''>Mois</option>";
								
						for($a = 0; $a <= 11; $a++)
						{
							$months = array('janvier', 'f&eacute;vrier', 'mars', 'avril', 'mai', 'juin', 'juillet','ao�t', 'septembre', 'octobre', 'novembre', 'd&eacute;cembre');
							
							if($saved[1] == ($a+1))
								 echo "\n<option value='".($a+1)."' selected='selected'>".$months[$a]."</option>";
							else
								 echo "\n<option value='".($a+1)."'>".$months[$a]."</option>";
						}
						?>
						</select> / <select name="dateN[2]" id="dateYear">
						<?php
                        
							$saved = savedInputValue("dateN");
							if($saved[2]=="")
								echo "\n<option value='' selected='selected'>Ann&eacute;e</option>";
							else
								echo "\n<option value=''>Ann&eacute;e</option>";
								
						for($a=(date("Y")-130);$a<=date("Y");$a++)
						{
							
							if($saved[2]==$a)
								echo "\n<option value='".$a."' selected='selected'>".$a."</option>";
							else
								echo "\n<option value='".$a."'>".$a."</option>";
						}
						?>
					</select>
					</div>
	
	  <div class="inscription3"><span class="boxVerif" id="agebox"></span></div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>

	  <div class="inscription parente">
	  <div class="inscription1">Votre Situation : *</div>
	  <div class="inscription2"><select name="situation[1]">
    <?php
		$saved = savedInputValue("situation");
		if($saved[1]=="")
    		echo '<option value="" selected="selected"></option>';
		else
			echo '<option value=""></option>';
		
		if($saved[1]=="C&eacute;libataire")
    	 	echo '<option value="C&eacute;libataire" selected="selected">C&eacute;libataire</option>';
		else
			echo '<option value="C&eacute;libataire">C&eacute;libataire</option>';
		
		if($saved[1]=="En Couple")
    		echo '<option value="En Couple" selected="selected">En Couple</option>';
		else
			echo '<option value="En Couple">En Couple</option>';
	?>
    </select> / <select name="situation[2]">
   <?php
    	if($saved[2]=="")
    		echo '<option value="" selected="selected"></option>';
		else
			echo '<option value=""></option>';
	 if($saved[2]=="Sans Enfant")
    	echo '<option value="Sans Enfant" selected="selected">Sans Enfant</option>';
	 else
		echo '<option value="Sans Enfant">Sans Enfant</option>';
	
	 if($saved[2]=="1 enfant")
    	echo '<option value="1 enfant" selected="selected">avec 1 enfant</option>';
	else
		echo '<option value="1 enfant">avec 1 enfant</option>';
		
	 if($saved[2]=="2 enfants")
    	echo '<option value="2 enfants" selected="selected">avec 2 enfants</option>';
	else
		echo '<option value="2 enfants">avec 2 enfants</option>';
		
	if($saved[2]=="3 enfants")
   		 echo '<option value="3 enfants" selected="selected">avec 3 enfants</option>';
	 else
	 	 echo '<option value="3 enfants">avec 3 enfants</option>';
		 
	 if($saved[2]=="4 enfants ou plus")
    	echo '<option value="4 enfants ou plus" selected="selected">avec 4 enfants ou plus</option>';
	else
		echo '<option value="4 enfants ou plus">avec 4 enfants ou plus</option>';
?>
    </select>
	
	</div>
	  <div class="inscription3"><span class="boxVerif" id="situationbox"></span></div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>

	  <div class="inscription parente">
	  <div class="inscription1">Votre localisation : *</div>
	  <div class="inscription2"><select name="localisation">
    <option value="">Votre ville</option>
 <?php
	/* dans le select un simple orderby suffit sur les champs d�partement et ville */
	$pdo->query("SET NAMES UTF8");
	$data = $pdo->prepare('SELECT * FROM forum_localisation ORDER BY ordre_departement,departement,ordre_ville,ville');
	$data->execute();
	/* initialisation de la variable d�partement */
	$departement ="";
        while($state = $data->fetch())
        {
	    /* si on fait le premier affichage */
            if(empty($departement))
	    	{
                /* On met un s�parateur sur la r�gion */
                echo '<optgroup label="'.$state[4].'">';
            }
	    /* Si c'est un deuxi�me affichage avec un changement de r�gion on ferme le s�parateur avant de le r�ouvrir */
	    elseif($departement != $state[4])
	    {
		echo '</optgroup><optgroup label="'.$state[4].'">';
	    }
	    /* on fait le selecte de la ville */
     		
			 if(savedInputValue("localisation")==$state[6])
			 	$select = ' selected="selected"';
			else
				$select = '';
				
            echo '<option value="'.$state[6].'"'.$select.'>'.$state[6].'</option>';
	    /* on affecte le d�partement actuel pour le comparer au tour suivant */
	    $departement  = $state[4];
        }
	/* comme le bouclage est termin� je ferme la balise de groupe */
	echo '</optgroup>';
	
	$data->closeCursor();
	?>
	
</select>    


</div>
	  <div class="inscription3"><span class="boxVerif" id="localisationbox"></span></div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>

	  <div class="inscriptionnot parente">
	  <div class="inscription1">Votre Etat : *</div>
	  <div class="inscription2"><select name="sante" onChange="CheckEtat(this.value);">
    <?php
	 if(savedInputValue("sante")=="")
	 	echo '<option value="" selected="selected"></option>';
	else
		echo '<option value=""></option>';
		
	 if(savedInputValue("sante")=="valide")
		echo '<option value="valide" selected="selected">Valide</option>';
	else
		echo '<option value="valide">Valide</option>';
		
	 if(savedInputValue("sante")=="handicap&eacute;")
		echo '<option value="handicap&eacute;" selected="selected">Handicap&eacute;</option>';
	else
		echo '<option value="handicap&eacute;">Handicap&eacute;</option>';
	?>
</select>
<input type="text" id="handicaper" style="display:none;"></div>
	  <div class="inscription3"><span class="boxVerif" id="etatbox"></span></div>
	  <div class="inscription4"><img src="../design/<?php echo getDesignName(); ?>/images/inscription/no.png"/></div>
	  </div>
	  </div>

      <div class="cadre_visible contenu">
	  <div class="titre">Options supl&eacute;mentaires...</div>

	  <div class="inscription parente">
	  <div class="inscription1">Newsletters</div>
	  <div class="inscription2"><?php
    	$pmail = savedInputValue("mail");
		if($pmail=="oui")
			echo '<input type="radio" name="mail" id="mailyes" value="oui" checked="checked"/>';
		else
			echo '<input type="radio" name="mail" id="mailyes" value="oui" />';
	?>
			 <span for="mailyes" style="float: none; font-weight: normal;">Oui</span>

             
             <?php
			 
			 	if($pmail=="non")
					echo '<input type="radio" name="mail" id="mailno" value="non" checked="checked" />';
				else
					echo '<input type="radio" name="mail" id="mailno" value="non"/>';
					
				?><span for="mailno" style="float: none; font-weight: normal;">Non</span>
                
                <?php
				$abonewsletter = savedInputValue("newsletter");
				$checked='';
				if($abonewsletter)
					$checked=' checked="checked"';
                                
                                
                                echo $GLOBALS["_msg"]['message_index_admin'];
var_dump($GLOBALS["_msg"]);

                                
				?>	


<input type="checkbox" name="newsletter" id="newsletter"<?php echo $checked; ?> /> 

</div>
	  <div class="inscription3"></div>
	  <div class="inscription4"></div>
	  </div>

	  <div class="inscription parente">
	  <div class="inscription1">Validez l'Inscription</div>
	  <div class="inscription2">J'ai lu et j'accepte les <?php echo '<a href=\"".getLienModule("reglement","reglement.admin")."?action=addCours_catForm\">conditions d\'utilisation</a>'?>
	  <input type="radio" name="mail" id="newsletters" value="oui" checked="checked"/> <span for="newsletters" style="float: none; font-weight: normal;">Oui</span> </div>
	  <div class="inscription3"></div>
	  <div class="inscription4"></div>
	  </div>

	  <div class="inscription parente">
	  <div class="inscription1">Antirobot</div>
	  <div class="inscription2"><?php // Recaptcha
	$publickey = '6LdiAskSAAAAAPkrlIzLRZ8dHpeNjMI3Csrs6uwr';
	
	
?>
	  <div class="cadre_transparent">
	  Recopiez correctement ce code ci-dessous : *
	  </div>

	  <div class="cadre_transparent texte_centrer">
	  <img name="cpcode" src="./includes/captcha.php?nocache=<?php echo mt_rand(10000000,90000000); ?>" />
	  </div>

	  <div class="cadre_transparent">
	  <a onClick="cpcode.src = './includes/captcha.php?nocache='+Math.random() * 1000000" style="cursor:pointer;">Changer de code</a><input type="text" id="recaptcha_response" name="recaptcha_response_field" />
	  </div>
	<!--	
	<div id="recaptcha_widget" style="display:none; margin-left: 230px;">
		<div id="recaptcha_image"></div>
		<div class="recaptcha_only_if_incorrect_sol" style="color:red">Incorrect. Veuillez r�essayer.</div>
			<span class="recaptcha_only_if_image"><label for="recaptcha_response_field" style="float: none;">Veuillez recopier les mots ci-dessus :</label></span>
				<span style="vertical-align: middle; display: inline-block;">
					<a href="javascript:Recaptcha.reload()"><img src="../../design/Basic/images/refresh.png" alt="" /></a>
				<a href="javascript:Recaptcha.showhelp()"><img src="../../design/Basic/images/help.png" alt="" /></a>
			</span>	
		
		<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
	</div>
             
	<script type="text/javascript"
		src="http://www.google.com/recaptcha/api/challenge?k=<?php echo $publickey; ?>">
	</script>

	<noscript>
		<iframe src="http://www.google.com/recaptcha/api/noscript?k=<?php echo $publickey; ?>"
			height="300" width="500" frameborder="0"></iframe><label>&nbsp;</label>
		<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
		<input type="hidden" name="recaptcha_response_field"
			value="manual_challenge" />
	</noscript>
         -->    
</div>
	  <div class="inscription3"></div>
	  <div class="inscription4"></div>
	  </div>

	  <div class="submit">
	  <input name="goRegister" type="submit" value="S'inscrire" OnClick="javascript:if(!control_form()) return false;" />
	  </form>
	  </div>
	  </div>